<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
		"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>{{PAGE_TITLE}}</title>
	<link rel="stylesheet" type="text/css" href="/Bike/ext/resources/css/ext-all.css" />
	<script type="text/javascript" src="/Bike/ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="/Bike/ext/ext-all.js"></script>
	<script type="text/javascript" src="/Bike/js/custom/grid.js"></script>
	<script type="text/javascript" src="/Bike/js/custom/ru.js"></script>
	<script type="text/javascript" src="/Bike/js/en.js"></script>
	<script type="text/javascript" src="/Bike/js/custom/fileBrowser/filebrowser.js"></script>
	<link rel="stylesheet" type="text/css" href="/Bike/js/custom/fileBrowser/resources/filebrowser.css" />
	<script type="text/javascript" src="/Bike/js/custom/tinyMCE/distrib/tiny_mce.js"></script>
	<script type="text/javascript" src="/Bike/js/custom/tinyMCE/Bike.form.js"></script>
	<script type="text/javascript" src="/Bike/js/custom/tinyMCE/Bike.tinymce.js"></script>
	<script type="text/javascript" src="/Bike/js/custom/tinyMCE/Ext.ux.TinyMCE.js"></script>
	<script type="text/javascript">
		Ext.Updater.defaults.loadScripts=true;
		var contentPanel = {
							region: 'center',
							xtype: 'tabpanel',
							id : 'tabPanel',
							activeTab: 0,
							items: {
								title: INDEX_WELCOME_TITLE,
								autoLoad: {url: '/admin/welcome/', scope: this, scripts: true}
							}
						};
		Ext.onReady(function(){
			var navTree = new Ext.tree.TreePanel({
				border:false,
				autoHeight:true,
				rootVisible:false,
				autoScroll:true,
				lines: false,
				singleExpand: true,
				useArrows: true,
				loader: new Ext.tree.TreeLoader({
					dataUrl:'/Bike/controllers/data.php?type=site_structure'
				}),
				root: new Ext.tree.AsyncTreeNode({
					text: 'Root',
					id: {{DOC_ID}}
				})
			});
			navTree.root.expand();
			navTree.on('click', function(node, e){
				e.stopEvent();
				if(node.isLeaf()){
					var tab = false;
					var tabPanel = viewPort.findByType('tabpanel');
					for (i in tabPanel[0].items.items){
						if(typeof(tabPanel[0].items.items[i]) == 'object' && node.attributes.href == tabPanel[0].items.items[i].autoLoad.url){
							tab = tabPanel[0].items.items[i];
						}
					}
					if(!tab){
						tab = tabPanel[0].add({title : node.attributes.text, closable: true, autoLoad : {url: node.attributes.href, scope: this, scripts : true }});
					}
					viewPort.items.items[1].setActiveTab(tab);
				}else{
				node.toggle();
				}
			});
			var navigationPanel = {
							region: 'west',
							title: INDEX_NAVIGATION_TITLE + ' // <a href="?logout=1">' + INDEX_NAVIGATION_LOGOUT + '</a>',
							width: 200,
							collapsible: true,
							margins:'0 5 0 5',
							items: [navTree]
						};
			var viewPort = new Ext.Viewport({
				layout:'border',
				items: [navigationPanel, contentPanel]
			});
		});
	</script>
</head>
<body>
	<div></div>
</body>
</html>